package com.fg.ihr;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;

import javax.servlet.MultipartConfigElement;

//https://www.jianshu.com/p/006e65711de0
@SpringBootApplication
public class IHRApplication {

    public static void main(String[] args) {
        SpringApplication.run(IHRApplication.class, args);
    }

//    @Value("${file.uploadFolder}")
//    private String uploadFolder;

    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        //单个文件最大
        factory.setMaxFileSize("10240KB"); //KB,MB
        /// 设置总上传数据总大小
        factory.setMaxFileSize("1024000KB");
//        factory.setLocation("c:/upload/");
        return factory.createMultipartConfig();
    }
}

